package com.zynn.count.exception;

import com.zynn.count.result.ResultEnum;
import lombok.Data;
import lombok.Getter;

/**
 * 基本的异常
 *
 * @author yu_chen
 * @date 2018/4/22 13:48
 */
@Getter
public class BaseException extends RuntimeException {

    private int code;

    /**
     * @param resultEnum 错误枚举类
     */
    public BaseException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());
        this.code = resultEnum.getCode();
    }

    /**
     * @param code 状态吗
     * @param message 错误信息
     */
    public BaseException(int code, String message) {
        super(message);
        this.code = code;
    }
}
